import { modelAdd, modelRemove } from './modelOpera.js';

let allObject = [];

class Z8FrameAdd {
  constructor(scene) {
    const modelData = [
      { url: './model/Z8架柜体.fbx', num: 1, x: -148, y: -43.5, z: 31 },
      {
        url: './model/开关主体.fbx', children: [
          { num: 2, x: -150, y: 54.5, z: 39, offsetZ: -6 },
        ]
      },
      {
        url: './model/开关拨片.fbx', children: [
          { num: 2, x: -146.5, y: 55.5, z: 40, offsetZ: -6 },
        ]
      },
      {
        url: './model/送电调整电阻盒.fbx', children: [
          { num: 5, x: -130, y: -50.5, z: 64, offsetY: 20 },
        ]
      },
      {
        url: './model/室内调整变压器.fbx', children: [
          { num: 5, x: -130, y: -50.5, z: 53, offsetY: 20 },
        ]
      },
      {
        url: './model/室内隔离盒.fbx', children: [
          { num: 5, x: -130, y: -50.5, z: 42, offsetY: 20 },
        ]
      },
      {
        url: './model/室内调整变压器.fbx', children: [
          { num: 5, x: -130, y: -50.5, z: 31, offsetY: 20 },
        ]
      },
      {
        url: './model/室内隔离盒.fbx', children: [
          { num: 5, x: -130, y: -50.5, z: 20, offsetY: 20 },
        ]
      },
      {
        url: './model/室内调整变压器.fbx', children: [
          { num: 4, x: -130, y: -30.7, z: 9, offsetY: 20 },
        ]
      },
      {
        url: './model/室内隔离盒.fbx', children: [
          { num: 4, x: -130, y: -30.7, z: -2, offsetY: 20 },
        ]
      },
      {
        url: './model/23路调整盒.fbx', children: [
          { num: 6, x: -146.5, y: -93, z: 58, offsetZ: -12 },
        ]
      },
      {
        url: './model/23路调整盒.fbx', children: [
          { num: 6, x: -146.5, y: -110, z: 58, offsetZ: -12 },
        ]
      },
    ];
    new modelAdd(modelData, (group) => {
      group.position.set(30, 0, -30);
      scene.add(group);
      allObject = group;
    });
  }
}
class Z8FrameRemove {
  constructor(scene) {
    new modelRemove(scene, allObject);
  }
}
export { Z8FrameAdd, Z8FrameRemove };